<html>
<h2>This is for Throw...</h2>
<input id="demo" type="text"></input>
<button onclick="myFunction()">Test</button>
<p id="mess"></p>

<script>
function myFunction()
{
	try
	{
		var input=document.getElementById("demo").innerHTML;
		if(input==" " || input =="") throw new Date();
		if(isNaN(input)) throw "Not a number";
		if(input==0) throw "zero";		
	}
	catch(e)
	{
		document.getElementById("mess").innerHTML = "Error is "+e.getHours()+".";		
	}
}

</script>

</body>
</html>